package org.lds.scheduled.job.admin.business.worker.converter;

import org.lds.scheduled.job.admin.business.worker.entity.Worker;
import org.lds.scheduled.job.admin.business.worker.model.request.WorkerBaseListPageRequest;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class WorkerBaseListPageRequestToEntityConverter implements Converter<WorkerBaseListPageRequest, Worker> {

    @Override
    public Worker convert(WorkerBaseListPageRequest source) {
        return Worker.builder()
                .id(source.getId())
                .appId(source.getAppId())
                .ip(source.getIp())
                .port(source.getPort())
                .enable(source.getEnable())
                .build();
    }

}


